package com.ehualu.javahadoop.test;

import com.ehualu.javahadoop.until.Timeuntil;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;


/**
 * @Author: 吴敬超
 * @Date: 2020/3/3 15:57
 */
public class timeuser {

    public static void main(String[] args) throws ParseException {
/*


        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

        String endTimeString = "2020-03-04";

        String nowtimeString = sdf.format(new Date());
        Date endTimeDate = sdf.parse(endTimeString);
        Date nowtimeTimeDate = sdf.parse(nowtimeString);

        if (endTimeDate.before(nowtimeTimeDate)){

            System.out.println("end< now");

        }else {

            System.out.println("end 不小于 now");
        }
*/


       /* if ((nowtimeTimeDate.before(beginTimeDate))) {

            nowtimeTimeDate.after()

            System.out.println("活动期内");
        } else {
            System.out.println("活动期外");

        }
*/
/*

        DateFormat dateFormat = DateFormat.getDateInstance();
        Date oldTime = null;
        try {
            oldTime = dateFormat.parse("2020-03-04");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        Date newTime = new Date();
        int result = oldTime.compareTo(newTime);
        System.out.println(result);
*/

        String startime = "2020-02-26";

        String endtime = "2020-03-01 11:04:53";


        Timeuntil timeuntil = new Timeuntil();

        try {
            boolean flag = timeuntil.timeflag(endtime);
            System.out.println("flag:" + flag);

        } catch (ParseException e) {
            e.printStackTrace();
        }
//        List<String> listdays = timeuntil.getDays(startime, endtime);
//
//
//        String strdays=timeuntil.getDaysstr(listdays);
//
//        System.out.println("strdays:"+strdays);

//        String time = "2019-07-23";
//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//        Date dateTime = null;
//        try {
//            dateTime = simpleDateFormat.parse(time);
//        } catch (ParseException e) {
//            e.printStackTrace();
//        }
    }
}
